/**
 * Member.java 下午6:02:18 2012-2-28
 * Cyber Information Technology Co.,Ltd.
 *   
 *   http://www.citchina.cn
 *   citchina.org@gmail.com
 */
package cn.cit.wcif.member.persistence.jpa.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Version;

import cn.cit.wcif.member.api.persistence.IMemberEntity;

/**
 * @author Jonathan
 * @version 1.0
 * 
 */
@Entity
@Table(name = "MEMBER")
@NamedQueries({
		@NamedQuery(name = "Member.findAll", query = "select m from MemberEntityImpl m"),
		@NamedQuery(name = "Member.findByEmail", query = "select m from MemberEntityImpl m where m.email = :email"),
		@NamedQuery(name = "Member.findByEmailAndPassword", query = "select m from MemberEntityImpl m where m.email = :email and m.password = :password"),
		@NamedQuery(name = "Member.findByEmailAndName", query = "select m from MemberEntityImpl m where m.email = :email and m.name = :name") })
public class MemberEntityImpl implements IMemberEntity {

	@Id
	@GeneratedValue
	private long id;
	private String email;// Email,做为唯一登录账号
	private String password;// 密码
	private String name;// 昵称
	private String sex;// 性别
	private String city;// 城市
	private String cellPhone;// 手机
	private String signature;// 签名
	private String avatar;// 获取头像
	private Boolean getingInfoByEmail;// 邮箱是否接受本站点信息
	private Boolean promptingForResponseedMyArticle;// 文章有回复信息是否提示

	@Version
	private int version;

	/**
	 * 
	 */
	public MemberEntityImpl() {
	}

	/**
	 * @param email
	 * @param password
	 */
	public MemberEntityImpl(String email, String password) {
		this.email = email;
		this.password = password;
	}

	/**
	 * @param email
	 * @param password
	 * @param name
	 */
	public MemberEntityImpl(String email, String password, String name) {
		this.email = email;
		this.password = password;
		this.name = name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#getId()
	 */
	@Override
	public long getId() {
		return this.id;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#getName()
	 */
	@Override
	public String getName() {
		return this.name;
	}

	/**
	 * @return the version
	 */
	public int getVersion() {
		return version;
	}

	/**
	 * @param version
	 *            the version to set
	 */
	public void setVersion(int version) {
		this.version = version;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	@Override
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	@Override
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the email
	 */
	@Override
	public String getEmail() {
		return email;
	}

	/**
	 * @param email
	 *            the email to set
	 */
	@Override
	public void setEmail(String email) {
		this.email = email;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#getPassword()
	 */
	@Override
	public String getPassword() {
		return this.password;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#getSex()
	 */
	@Override
	public String getSex() {
		return this.sex;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#getCity()
	 */
	@Override
	public String getCity() {
		return this.city;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#cellPhone()
	 */
	@Override
	public String getCellPhone() {
		return this.cellPhone;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#getSignature()
	 */
	@Override
	public String getSignature() {
		return this.signature;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#getAvatar()
	 */
	@Override
	public String getAvatar() {
		return this.avatar;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#isGetingInfoByEmail()
	 */
	@Override
	public Boolean isGetingInfoByEmail() {
		return this.getingInfoByEmail;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#
	 * isPromptForResponseedMyArticle()
	 */
	@Override
	public Boolean isPromptingForResponseedMyArticle() {
		return this.promptingForResponseedMyArticle;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#setPassword(java.lang
	 * .String)
	 */
	@Override
	public void setPassword(String password) {
		this.password = password;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#setSex(java.lang.String
	 * )
	 */
	@Override
	public void setSex(String sex) {
		this.sex = sex;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#setCity(java.lang.String
	 * )
	 */
	@Override
	public void setCity(String city) {
		this.city = city;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#sellPhone(java.lang
	 * .String)
	 */
	@Override
	public void setCellPhone(String cellPhone) {
		this.cellPhone = cellPhone;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#setSignature(java.lang
	 * .String)
	 */
	@Override
	public void setSignature(String signature) {
		this.signature = signature;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#setAvatar(java.lang
	 * .String)
	 */
	@Override
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.cit.outman.member.api.persistence.MemberEntity#setInfoByEmail(java
	 * .lang.Boolean)
	 */
	@Override
	public void setGetingInfoByEmail(Boolean flag) {
		this.getingInfoByEmail = flag;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.cit.outman.member.api.persistence.MemberEntity#
	 * setPromptForResponseedMyArticle(java.lang.Boolean)
	 */
	@Override
	public void setPromptingForResponseedMyArticle(Boolean flag) {
		this.promptingForResponseedMyArticle = flag;
	}

}
